package com.ityj.yygh.hospital.controller;

import com.ityj.yygh.hospital.service.DepartmentService;
import com.ityj.yygh.result.Result;
import com.ityj.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(value = "医院科室信息管理")
@RestController
@RequestMapping(path = "/admin/hosp/department")
@Slf4j
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @ApiOperation(value = "获取医院科室信息")
    @GetMapping(path = "/findDepartmentList/{hospcode}")
    public Result<List<DepartmentVo>> findDepartmentDetailByHospcode(String hospcode) {
        List<DepartmentVo> departmentList = departmentService.findDepartmentDetailByHospcode(hospcode);
        log.info("res: {}", departmentList);
        return Result.ok(departmentList);
    }
}
